home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update16.zoo / pml / diffs
Encoding:
Text File  |  1992-03-06  |  21.0 KB  |  992 lines

  1. *** 1.12    1992/02/04 16:42:12
  2. --- Changelog    1992/03/06 19:37:53
  3. ***************
  4. *** 252,254 ****
  5. --- 252,270 ----
  6.   the correct parameters.
  7.   
  8.   ---------------------------- Patchlevel 15 ------------------------------
  9. + Makefile.tos:: Michal
  10. +     use macros to make it easier to to adjust.
  11. + atan2.c: mjr++
  12. + ccos.c:
  13. + cdiv.c:
  14. + cmult.c:
  15. + csin.c:
  16. +     new assembler routines for both the sfp004 and the 881/882
  17. + cadd.c: mjr++
  18. + csubt.c:
  19. +     fixed nasty arg passing bug in the sfp code.
  20. + ---------------------------- Patchlevel 16 ------------------------------
  21. *** 1.7    1992/02/03 20:22:27
  22. --- Makefile.tos    1992/03/06 19:37:54
  23. ***************
  24. *** 3,8 ****
  25. --- 3,12 ----
  26.   CROSSBIN = $(CROSSDIR)/bin
  27.   CROSSINC = $(CROSSDIR)/include
  28.   XFLAGS = -Wstrict-prototypes
  29. + #this has to be gnu make
  30. + MAKE=make
  31. + CC=cgcc
  32. + AR=car
  33.   
  34.   ALL = pml16.olb pml.olb
  35.   
  36. ***************
  37. *** 9,28 ****
  38.   all : $(ALL)
  39.   
  40.   pml16.olb :
  41. !     make -f makefile.pml clean
  42. !     make -f makefile.pml CC="cgcc" AR="car" XFLAGS="$(XFLAGS)" s=true
  43.   
  44.   pml.olb :
  45. !     make -f makefile.pml clean
  46. !     make -f makefile.pml CC="cgcc" AR="car" XFLAGS="$(XFLAGS)"
  47.   
  48.   pml02016.olb :
  49. !     make -f makefile.pml clean
  50. !     make -f makefile.pml CC="cgcc -m68020" AR="car" XFLAGS="$(XFLAGS)" m=68881 s=true
  51.   
  52.   pml020.olb :
  53. !     make -f makefile.pml clean
  54. !     make -f makefile.pml CC="cgcc -m68020" AR="car" XFLAGS="$(XFLAGS)" m=68881
  55.   
  56.   install : $(ALL)
  57.       cp pml16.olb pml.olb $(CROSSLIB)
  58. --- 13,34 ----
  59.   all : $(ALL)
  60.   
  61.   pml16.olb :
  62. !     $(MAKE) -f makefile.pml clean
  63. !     $(MAKE) -f makefile.pml CC="$(CC)" AR="$(AR)" XFLAGS="$(XFLAGS)" s=true
  64.   
  65.   pml.olb :
  66. !     $(MAKE) -f makefile.pml clean
  67. !     $(MAKE) -f makefile.pml CC="$(CC)" AR="$(AR)" XFLAGS="$(XFLAGS)"
  68.   
  69.   pml02016.olb :
  70. !     $(MAKE) -f makefile.pml clean
  71. !     $(MAKE) -f makefile.pml CC="$(CC) -m68020" AR="$(AR)" \
  72. !  XFLAGS="$(XFLAGS)" m=68881 s=true
  73.   
  74.   pml020.olb :
  75. !     $(MAKE) -f makefile.pml clean
  76. !     $(MAKE) -f makefile.pml CC="$(CC) -m68020" AR="$(AR)" \
  77. !  XFLAGS="$(XFLAGS)" m=68881
  78.   
  79.   install : $(ALL)
  80.       cp pml16.olb pml.olb $(CROSSLIB)
  81. ***************
  82. *** 33,41 ****
  83.       cp math.h $(CROSSINC)
  84.   
  85.   clean:
  86. !     make -f makefile.pml clean
  87. !     make -f makefile.pml clean
  88.   
  89.   realclean:
  90. !     make -f makefile.pml realclean
  91. !     make -f makefile.pml realclean
  92. --- 39,47 ----
  93.       cp math.h $(CROSSINC)
  94.   
  95.   clean:
  96. !     $(MAKE) -f makefile.pml clean
  97. !     $(MAKE) -f makefile.pml clean
  98.   
  99.   realclean:
  100. !     $(MAKE) -f makefile.pml realclean
  101. !     $(MAKE) -f makefile.pml realclean
  102. *** 1.12    1992/02/04 16:42:12
  103. --- PatchLevel.h    1992/03/06 19:37:54
  104. ***************
  105. *** 1,5 ****
  106.   /*
  107. !  *    PatchLevel: 15
  108.    *
  109.    *    the Patch Level above is to identify the version
  110.    *    of the all the files in this directory. given the above
  111. --- 1,5 ----
  112.   /*
  113. !  *    PatchLevel: 16
  114.    *
  115.    *    the Patch Level above is to identify the version
  116.    *    of the all the files in this directory. given the above
  117. *** 1.7    1992/02/03 20:19:23
  118. --- atan2.c    1992/03/06 19:37:56
  119. ***************
  120. *** 87,92 ****
  121. --- 87,94 ----
  122.    *
  123.    */
  124.   
  125. + #if !defined (__M68881__) && !defined (sfp004)
  126.   #include <stdio.h>
  127.   #include <math.h>
  128.   #include "pml.h"
  129. ***************
  130. *** 124,126 ****
  131. --- 126,280 ----
  132.       return (result);
  133.   }
  134.   
  135. + #endif !defined (__M68881__) && !defined (sfp004)
  136. + #ifdef    __M68881__
  137. + __asm("
  138. + .text
  139. + .even
  140. + _funcname:
  141. +     .ascii    \"atan2\\0\"
  142. +     .even
  143. + .globl    _atan2
  144. + _atan2:
  145. + | denormalized numbers are treated as 0
  146. +     tstl    sp@(12)
  147. +     beq    5f        | x == 0!
  148. +     blt    1f        | x < 0!
  149. +                 | x > 0: return atan(y/x)
  150. +     fmoved    sp@(4)@,fp0    | get y
  151. +     fdivd    sp@(12),fp0    | y/x    
  152. +     fatanx    fp0,fp0        | atan(y/x)
  153. +     bra 3f            | return
  154. + 1:                | x < 0
  155. +     fmovecr    #0,fp1        | get pi
  156. +     fmoved    sp@(4)@,fp0    | get y
  157. +     fdivd    sp@(12),fp0    | y/x
  158. +     fatanx    fp0,fp0        | atan(y/x)
  159. +     btst    #31,sp@(4)    | sign(y)
  160. +     beq    2f        | positive!
  161. +     fnegx    fp1,fp1        | transfer sign
  162. + 2:    faddx    fp1,fp0        | sign(y)*pi + atan(y/x)
  163. + |    bra 3f            | return
  164. + 3:
  165. +     fmoved    fp0,sp@-    | return result
  166. +     moveml    sp@+,d0/d1
  167. + 4:    
  168. +     rts            | sigh.
  169. + 5:                | x == 0
  170. +     movel    #1073291771,d0    | pi/2
  171. +     movel    #1413754136,d1    |
  172. +     tstl    sp@(4)        | 
  173. +     beq    6f        | NaN
  174. +     bge    4b        | exit
  175. +     bset    #31,d0        | x < 0 : return -pi/2
  176. +     bra    4b
  177. + 6:    movel    #-1,d0        | NaN
  178. +     movel    #-1,d1        |
  179. +     bra    4b
  180. + ");    /* end asm    */
  181. + #endif    __M68881__
  182. + #ifdef    sfp004
  183. + __asm("
  184. + comm =     -6
  185. + resp =    -16
  186. + zahl =      0
  187. + .even
  188. + .text
  189. + .even
  190. + _funcname:
  191. +     .ascii    \"atan2\\0\"
  192. +     .even
  193. + .text
  194. + .even
  195. + .globl    _atan2
  196. + _atan2:
  197. + | denormalized numbers are treated as 0
  198. +     lea    0xfffa50,a0
  199. +     moveml    a7@(12),d0-d1    |  x
  200. +     tstl    d0
  201. +     beq    5f        | x == 0!
  202. +     blt    1f        | x < 0!
  203. +                 | x > 0: return atan(y/x)
  204. + |    fmoved    sp@(4),fp0    | get y
  205. +     movew    #0x5400,a0@(comm)
  206. +     .long    0x0c688900, 0xfff067f8
  207. +     movel    sp@(4),a0@
  208. +     movel    sp@(8),a0@
  209. + |    fdivd    sp@(12),fp0    | y/x
  210. +     movew    #0x5420,a0@(comm)
  211. +     .long    0x0c688900, 0xfff067f8
  212. +     movel    d0,a0@
  213. +     movel    d1,a0@
  214. + |    fatanx    fp0,fp0        | atan(y/x)
  215. +     movew    #0x000a,a0@(comm)
  216. +     .word    0x4a68,0xfff0,0x6bfa
  217. +     bra 3f            | return
  218. + 1:                | x < 0
  219. + |    fmovecr    #0,fp1        | get pi
  220. +     movew    #0x5c80,a0@(comm)
  221. +     .long    0x0c688900, 0xfff067f8
  222. + |    fmoved    sp@(4),fp0    | get y
  223. +     movew    #0x5400,a0@(comm)
  224. +     .long    0x0c688900, 0xfff067f8
  225. +     movel    sp@(4),a0@
  226. +     movel    sp@(8),a0@
  227. + |    fdivd    sp@(12),fp0    | y/x
  228. +     movew    #0x5420,a0@(comm)
  229. +     .long    0x0c688900, 0xfff067f8
  230. +     movel    d0,a0@
  231. +     movel    d1,a0@
  232. + |    fatanx    fp0,fp0        | atan(y/x)
  233. +     movew    #0x000a,a0@(comm)
  234. +     .word    0x4a68,0xfff0,0x6bfa
  235. +     btst    #31,sp@(4)    | sign(y)
  236. +     beq    2f        | positive!
  237. + |    fnegx    fp1,fp1        | transfer sign
  238. +     movew    #0x049a,a0@(comm)
  239. +     .word    0x4a68,0xfff0,0x6bfa
  240. + 2:|    faddx    fp1,fp0        | sign(y)*pi + atan(y/x)
  241. +     movew    #0x0422,a0@(comm)
  242. +     .word    0x4a68,0xfff0,0x6bfa
  243. + |    bra 3f            | return
  244. + 3:
  245. + |    fmoved    fp0,d0-d1    | return result
  246. +     movew    #0x7400,a0@(comm)
  247. +     .long    0x0c688900, 0xfff067f8
  248. +     movel    a0@,d0
  249. +     movel    a0@,d1
  250. + 4:    
  251. +     rts            | sigh.
  252. + 5:                | x == 0
  253. +     movel    #1073291771,d0    | pi/2
  254. +     movel    #1413754136,d1    |
  255. +     tstl    sp@(4)        | 
  256. +     beq    6f        | NaN
  257. +     bge    4b        | exit
  258. +     bset    #31,d0        | x < 0 : return -pi/2
  259. +     bra    4b
  260. + 6:    movel    #-1,d0        | NaN
  261. +     movel    #-1,d1        |
  262. +     bra    4b
  263. + ");    /* end asm    */
  264. + #endif    sfp004
  265. *** 1.3    1992/02/03 20:19:23
  266. --- cadd.c    1992/03/06 19:37:57
  267. ***************
  268. *** 120,127 ****
  269.   
  270.       movew    #0x5422,a0@(comm)    | fp0 += z2.real
  271.       .long    0x0c688900, 0xfff067f8
  272. !     movel    a7@(4),a0@        | load arg_hi
  273. !     movel    a7@(8),a0@        | load arg_low
  274.   
  275.       movew    #0x5480,a0@(comm)    | z1.imag -> fp1
  276.       .long    0x0c688900, 0xfff067f8
  277. --- 120,127 ----
  278.   
  279.       movew    #0x5422,a0@(comm)    | fp0 += z2.real
  280.       .long    0x0c688900, 0xfff067f8
  281. !     movel    a7@(20),a0@        | load arg_hi
  282. !     movel    a7@(24),a0@        | load arg_low
  283.   
  284.       movew    #0x5480,a0@(comm)    | z1.imag -> fp1
  285.       .long    0x0c688900, 0xfff067f8
  286. ***************
  287. *** 129,138 ****
  288.       movel    a7@(16),a0@        | load arg_low
  289.   
  290.       movew    #0x54a2,a0@(comm)    | fp1 += z2.imag
  291. !     movel    a1,d0             pointer to result
  292.       .long    0x0c688900, 0xfff067f8
  293. !     movel    a7@(4),a0@        | load arg_hi
  294. !     movel    a7@(8),a0@        | load arg_low
  295.   
  296.   |    movew    #%0111 0101 0000 0000,a0@(comm)    | fetch fp0
  297.       movew    #0x7400,a0@(comm)        | 
  298. --- 129,138 ----
  299.       movel    a7@(16),a0@        | load arg_low
  300.   
  301.       movew    #0x54a2,a0@(comm)    | fp1 += z2.imag
  302. !     movel    a1,d0            | pointer to result
  303.       .long    0x0c688900, 0xfff067f8
  304. !     movel    a7@(28),a0@        | load arg_hi
  305. !     movel    a7@(32),a0@        | load arg_low
  306.   
  307.   |    movew    #%0111 0101 0000 0000,a0@(comm)    | fetch fp0
  308.       movew    #0x7400,a0@(comm)        | 
  309. *** 1.4    1992/02/03 20:19:23
  310. --- ccos.c    1992/03/06 19:37:58
  311. ***************
  312. *** 61,69 ****
  313.    *
  314.    */
  315.   
  316. ! #if defined (__M68881__) && !defined (_M68881)
  317. ! /*# define _M68881*/
  318. ! #endif
  319.   
  320.   #include <stdio.h>
  321.   #include <math.h>
  322. --- 61,67 ----
  323.    *
  324.    */
  325.   
  326. ! #if !defined (__M68881__) && !defined (sfp004)
  327.   
  328.   #include <stdio.h>
  329.   #include <math.h>
  330. ***************
  331. *** 79,81 ****
  332. --- 77,195 ----
  333.       result.imag = -sin(z.real) * sinh(z.imag);
  334.       return (result);
  335.   }
  336. + #endif !defined (__M68881__) && !defined (sfp004)
  337. + #ifdef    __M68881__
  338. + __asm("
  339. + .text
  340. + _funcname:
  341. +     .ascii    \"ccos\\0\"
  342. +     .even
  343. +     .globl _ccos
  344. + _ccos:
  345. +     movel    a1,d0        | save a1 as return value
  346. +     fmoved    sp@(4),fp0    | z.real
  347. +     fsinx    fp0,fp1        | cos(z.real)
  348. +     fcosx    fp0,fp0        | sin(z.real)
  349. +     fnegx    fp1,fp1        |-sin(z.real)
  350. +     fmoved    sp@(12),fp3    | z.imag
  351. +     fcoshx    fp3,fp2        | cosh(z.imag)
  352. +     fsinhx    fp3,fp3        | sinh(z.imag)
  353. +     
  354. +     fmulx    fp2,fp0        | result.real
  355. +     fmoved    fp0,a1@        |
  356. +     fmulx    fp3,fp1        | result.imag
  357. +     fmoved    fp1,a1@(8)    |
  358. + ");    /* end asm    */
  359. + #endif    __M68881__
  360. + #ifdef    sfp004
  361. + __asm("
  362. + | double precision floating point stuff for Atari-gcc using the SFP004
  363. + | developed with gas
  364. + |
  365. + | double precision complex sin
  366. + |
  367. + | M. Ritzert (mjr at dmzrzu71)
  368. + |
  369. + | 12.10.1990
  370. + |
  371. + | addresses of the 68881 data port. This choice is fastest when much data is
  372. + | transferred between the two processors.
  373. + comm =     -6
  374. + resp =    -16
  375. + zahl =      0
  376. + | waiting loop ...
  377. + |
  378. + | wait:
  379. + | ww:    cmpiw    #0x8900,a1@(resp)
  380. + |     beq    ww
  381. + | is coded directly by
  382. + |    .long    0x0c688900, 0xfff067f8
  383. + | and
  384. + | www:    tst.b    a1@(resp)
  385. + |    bmi.b    www
  386. + | is coded by
  387. + |    .word    0x4a68,0xfff0,0x6bfa        | test
  388. +     .text; .even
  389. +     .globl _ccos
  390. + _ccos:
  391. +     movel    a1,d0                | save a1 as return value
  392. +     lea    0xfffa50,a0            | fpu address
  393. +     movew    #0x54b0,a0@(comm)        | sincos: sin -> fp1
  394. +     .long    0x0c688900, 0xfff067f8        |      cos -> fp0
  395. +     movel    sp@(4), a0@            | load z.real
  396. +     movel    sp@(8), a0@            | load z.real
  397. + |    fmoved    sp@(12),fp3            | z.imag to fp3
  398. +     movew    #0x5580,a0@(comm)
  399. +     .long    0x0c688900, 0xfff067f8
  400. +     movel    sp@(12),a0@
  401. +     movel    sp@(16),a0@
  402. + |    fcoshx    fp3,fp2                | cosh(z.imag)
  403. +     movew    #0x0d19,a0@(comm)
  404. +     .word    0x4a68,0xfff0,0x6bfa        | test
  405. + |    fsinhx    fp3,fp3                | sinh(z.imag)
  406. +     movew    #0x0d82,a0@(comm)
  407. +     .word    0x4a68,0xfff0,0x6bfa        | test
  408. + |    fmulx    fp2,fp0                | result.real
  409. +     movew    #0x0823,a0@(comm)
  410. +     .word    0x4a68,0xfff0,0x6bfa        | test
  411. + |    fmoved    fp0,a1@                |
  412. +     movew    #0x7400,a0@(comm)        | 
  413. +     .long    0x0c688900, 0xfff067f8
  414. +     movel    a0@,a1@
  415. +     movel    a0@,a1@(4)
  416. + |    fmulx    fp3,fp1                | result.imag
  417. +     movew    #0x0ca3,a0@(comm)
  418. +     .word    0x4a68,0xfff0,0x6bfa        | test
  419. + |    fnegx    fp1,fp1
  420. +     movew    #0x049a,a0@(comm)
  421. +     .word    0x4a68,0xfff0,0x6bfa        | test
  422. + |    fmoves    fp1,d1                |
  423. +     movew    #0x7480,a0@(comm)        |
  424. +     .long    0x0c688900, 0xfff067f8
  425. +     movel    a0@,a1@(8)
  426. +     movel    a0@,a1@(12)
  427. + ");    /* end asm    */
  428. + #endif    sfp004
  429. + #if defined (__M68881__) || defined (sfp004)
  430. + # ifdef ERROR_CHECK    /* no error checking for now    */
  431. + __asm("
  432. +     pea    _funcname
  433. +     jmp    c_err_check
  434. + ");    /* end asm    */
  435. + # else  ERROR_CHECK
  436. + __asm("rts");
  437. + # endif ERROR_CHECK
  438. + #endif defined (__M68881__) || defined (sfp004)
  439. *** 1.3    1992/02/03 20:19:23
  440. --- cdiv.c    1992/03/06 19:37:59
  441. ***************
  442. *** 68,76 ****
  443.    *
  444.    */
  445.   
  446. ! #if defined (__M68881__) && !defined (_M68881)
  447. ! /*# define _M68881*/
  448. ! #endif
  449.   
  450.   #include <stdio.h>
  451.   #include <math.h>
  452. --- 68,74 ----
  453.    *
  454.    */
  455.   
  456. ! #if !defined (__M68881__) && !defined (sfp004)
  457.   
  458.   #include <stdio.h>
  459.   #include <math.h>
  460. ***************
  461. *** 114,116 ****
  462. --- 112,268 ----
  463.       }
  464.       return (result);
  465.   }
  466. + #endif !defined (__M68881__) && !defined (sfp004)
  467. + #ifdef    __M68881__
  468. + __asm("
  469. + .text
  470. + .even
  471. + _funcname:
  472. +     .ascii    \"cdiv\\0\"
  473. +     .even
  474. + .globl    _cdiv
  475. + _cdiv:
  476. +     fmoved    sp@(4),fp0
  477. +     fmoved    sp@(12),fp1
  478. +     fmoved    sp@(20),fp2
  479. +     fmoved    sp@(28),fp3
  480. +     fmovex    fp0,fp4
  481. +     movel    a1,d0        | pointer to result
  482. +     fmovex    fp2,fp5
  483. +     fmulx    fp2,fp5
  484. +     fmovex    fp3,fp6
  485. +     fmulx    fp3,fp6
  486. +     faddx    fp6,fp5
  487. +     fmulx    fp2,fp4
  488. +     fmulx    fp3,fp0
  489. +     fmulx    fp1,fp2    
  490. +     fmulx    fp1,fp3
  491. +     faddx    fp3,fp4
  492. +     fdivx    fp5,fp4
  493. +     fsubx    fp0,fp2
  494. +     fdivx    fp5,fp2
  495. +     fmoved    fp4,a1@
  496. +     fmoved    fp2,a1@(8)
  497. + ");    /* end asm    */
  498. + #endif    __M68881__
  499. + #ifdef    sfp004
  500. + __asm("
  501. + comm =     -6
  502. + resp =    -16
  503. + zahl =      0
  504. + .even
  505. + .text
  506. + .even
  507. + _funcname:
  508. +     .ascii    \"cdiv\\0\"
  509. +     .even
  510. + .text
  511. + .even
  512. + .globl    _cdiv
  513. + _cdiv:
  514. +     lea    0xfffa50,a0
  515. +     movew    #0x5400,a0@(comm)    | z1.real -> fp0
  516. +     movel    a1,d0            | pointer to result
  517. +     .long    0x0c688900, 0xfff067f8
  518. +     movel    a7@(4),a0@        | load arg_hi
  519. +     movel    a7@(8),a0@        | load arg_low
  520. +     movew    #0x5480,a0@(comm)    | z1.imag -> fp1
  521. +     .long    0x0c688900, 0xfff067f8
  522. +     movel    a7@(12),a0@        | load arg_hi
  523. +     movel    a7@(16),a0@        | load arg_low
  524. +     movew    #0x5500,a0@(comm)    | z2.real -> fp2
  525. +     .long    0x0c688900, 0xfff067f8
  526. +     movel    a7@(20),a0@        | load arg_hi
  527. +     movel    a7@(24),a0@        | load arg_low
  528. +     movew    #0x5580,a0@(comm)    | z2.imag -> fp3
  529. +     .long    0x0c688900, 0xfff067f8
  530. +     movel    a7@(28),a0@        | load arg_hi
  531. +     movel    a7@(32),a0@        | load arg_low
  532. +     movew    #0x0200,a0@(comm)    | copy fp0 to fp4
  533. +     .word    0x4a68,0xfff0,0x6bfa    | test
  534. + |    fmovex    fp2,fp5
  535. +     movew    #0x0a80,a0@(comm)
  536. +     .word    0x4a68,0xfff0,0x6bfa    | test
  537. + |    fmulx    fp2,fp5
  538. +     movew    #0x0aa3,a0@(comm)
  539. +     .word    0x4a68,0xfff0,0x6bfa    | test
  540. + |    fmovex    fp3,fp6
  541. +     movew    #0x0f00,a0@(comm)
  542. +     .word    0x4a68,0xfff0,0x6bfa    | test
  543. + |    fmulx    fp3,fp6
  544. +     movew    #0x0f23,a0@(comm)
  545. +     .word    0x4a68,0xfff0,0x6bfa    | test
  546. + |    faddx    fp6,fp5
  547. +     movew    #0x1aa2,a0@(comm)
  548. +     .word    0x4a68,0xfff0,0x6bfa    | test
  549. + |    fmulx    fp2,fp4
  550. +     movew    #0x0a23,a0@(comm)
  551. +     .word    0x4a68,0xfff0,0x6bfa    | test
  552. + |    fmulx    fp3,fp0
  553. +     movew    #0x0c23,a0@(comm)
  554. +     .word    0x4a68,0xfff0,0x6bfa    | test
  555. + |    fmulx    fp1,fp2
  556. +     movew    #0x0523,a0@(comm)
  557. +     .word    0x4a68,0xfff0,0x6bfa    | test
  558. + |    fmulx    fp1,fp3
  559. +     movew    #0x05a3,a0@(comm)
  560. +     .word    0x4a68,0xfff0,0x6bfa    | test
  561. + |    faddx    fp3,fp4
  562. +     movew    #0x0e22,a0@(comm)
  563. +     .word    0x4a68,0xfff0,0x6bfa    | test
  564. + |    fdivx    fp5,fp4
  565. +     movew    #0x1620,a0@(comm)
  566. +     .word    0x4a68,0xfff0,0x6bfa    | test
  567. + |    fsubx    fp0,fp2
  568. +     movew    #0x0128,a0@(comm)
  569. +     .word    0x4a68,0xfff0,0x6bfa    | test
  570. + |    fdivx    fp5,fp2
  571. +     movew    #0x1520,a0@(comm)
  572. +     .word    0x4a68,0xfff0,0x6bfa    | test
  573. + |    fmoved    fp4,a1@
  574. +     movew    #0x7600,a0@(comm)        | 
  575. +     .long    0x0c688900, 0xfff067f8
  576. +     movel    a0@,a1@
  577. +     movel    a0@,a1@(4)
  578. + |    fmoved    fp2,a1@(8)
  579. +     movew    #0x7500,a0@(comm)        | 
  580. +     .long    0x0c688900, 0xfff067f8
  581. +     movel    a0@,a1@(8)
  582. +     movel    a0@,a1@(12)
  583. + ");    /* end asm    */
  584. + #endif    sfp004
  585. + #if defined (__M68881__) || defined (sfp004)
  586. + # ifdef ERROR_CHECK    /* no error checking for now    */
  587. + __asm("    
  588. +     pea    _funcname
  589. +     jmp    c_err_check
  590. + ");    /* end asm    */
  591. + # else  ERROR_CHECK
  592. + __asm("rts");
  593. + # endif ERROR_CHECK
  594. + #endif defined (__M68881__) || defined (sfp004)
  595. *** 1.3    1992/02/03 20:19:23
  596. --- cmult.c    1992/03/06 19:38:00
  597. ***************
  598. *** 62,70 ****
  599.    *
  600.    */
  601.   
  602. ! #if defined (__M68881__) && !defined (_M68881)
  603. ! /*# define _M68881*/
  604. ! #endif
  605.   
  606.   #include <stdio.h>
  607.   #include <math.h>
  608. --- 62,68 ----
  609.    *
  610.    */
  611.   
  612. ! #if !defined (__M68881__) && !defined (sfp004)
  613.   
  614.   #include <stdio.h>
  615.   #include <math.h>
  616. ***************
  617. *** 81,83 ****
  618. --- 79,203 ----
  619.   
  620.       return (result);
  621.   }
  622. + #endif !defined (__M68881__) && !defined (sfp004)
  623. + #ifdef    __M68881__
  624. + __asm("
  625. + .text
  626. + .even
  627. + _funcname:
  628. +     .ascii    \"cmult\\0\"
  629. +     .even
  630. + .globl    _cmult
  631. + _cmult:
  632. +     fmoved    sp@(4),fp0
  633. +     fmoved    sp@(12),fp1
  634. +     fmoved    sp@(20),fp2
  635. +     fmoved    sp@(28),fp3
  636. +     fmovex    fp0,fp4
  637. +     movel    a1,d0        | pointer to result
  638. +     fmulx    fp2,fp4
  639. +     fmulx    fp3,fp0
  640. +     fmulx    fp1,fp2
  641. +     fmulx    fp1,fp3
  642. +     fsubx    fp3,fp4
  643. +     faddx    fp0,fp2
  644. +     fmoved    fp4,a1@
  645. +     fmoved    fp2,a1@(8)
  646. + ");    /* end asm    */
  647. + #endif    __M68881__
  648. + #ifdef    sfp004
  649. + __asm("
  650. + comm =     -6
  651. + resp =    -16
  652. + zahl =      0
  653. + .even
  654. + .text
  655. + .even
  656. + _funcname:
  657. +     .ascii    \"cmult\\0\"
  658. +     .even
  659. + .text
  660. + .even
  661. + .globl    _cmult
  662. + _cmult:
  663. +     lea    0xfffa50,a0
  664. +     movew    #0x5400,a0@(comm)    | z1.real -> fp0
  665. +     movel    a1,d0        | pointer to result
  666. +     .long    0x0c688900, 0xfff067f8
  667. +     movel    a7@(4),a0@        | load arg_hi
  668. +     movel    a7@(8),a0@        | load arg_low
  669. +     movew    #0x5480,a0@(comm)    | z1.imag -> fp1
  670. +     .long    0x0c688900, 0xfff067f8
  671. +     movel    a7@(12),a0@        | load arg_hi
  672. +     movel    a7@(16),a0@        | load arg_low
  673. +     movew    #0x5500,a0@(comm)    | z2.real -> fp2
  674. +     .long    0x0c688900, 0xfff067f8
  675. +     movel    a7@(20),a0@        | load arg_hi
  676. +     movel    a7@(24),a0@        | load arg_low
  677. +     movew    #0x5580,a0@(comm)    | z2.imag -> fp3
  678. +     .long    0x0c688900, 0xfff067f8
  679. +     movel    a7@(28),a0@        | load arg_hi
  680. +     movel    a7@(32),a0@        | load arg_low
  681. +     movew    #0x0200,a0@(comm)    | copy fp0 to fp4
  682. +     .word    0x4a68,0xfff0,0x6bfa    | test
  683. + |    fmulx    fp2,fp4
  684. +     movew    #0x0a23,a0@(comm)
  685. +     .word    0x4a68,0xfff0,0x6bfa    | test
  686. + |    fmulx    fp3,fp0
  687. +     movew    #0x0c23,a0@(comm)
  688. +     .word    0x4a68,0xfff0,0x6bfa    | test
  689. + |    fmulx    fp1,fp2
  690. +     movew    #0x0523,a0@(comm)
  691. +     .word    0x4a68,0xfff0,0x6bfa    | test
  692. + |    fmulx    fp1,fp3
  693. +     movew    #0x05a3,a0@(comm)
  694. +     .word    0x4a68,0xfff0,0x6bfa    | test
  695. + |    fsubx    fp3,fp4
  696. +     movew    #0x0e28,a0@(comm)
  697. +     .word    0x4a68,0xfff0,0x6bfa    | test
  698. + |    faddx    fp0,fp2
  699. +     movew    #0x0122,a0@(comm)
  700. +     .word    0x4a68,0xfff0,0x6bfa    | test
  701. + |    fmoved    fp4,a1@
  702. +     movew    #0x7600,a0@(comm)        | 
  703. +     .long    0x0c688900, 0xfff067f8
  704. +     movel    a0@,a1@
  705. +     movel    a0@,a1@(4)
  706. + |    fmoved    fp2,d1
  707. +     movew    #0x7500,a0@(comm)        | 
  708. +     .long    0x0c688900, 0xfff067f8
  709. +     movel    a0@,a1@(8)
  710. +     movel    a0@,a1@(12)
  711. + ");    /* end asm    */
  712. + #endif    sfp004
  713. + #if defined (__M68881__) || defined (sfp004)
  714. + # ifdef ERROR_CHECK    /* no error checking for now    */
  715. + __asm("    
  716. +     pea    _funcname
  717. +     jmp    c_err_check
  718. + ");    /* end asm    */
  719. + # else  ERROR_CHECK
  720. + __asm("rts");
  721. + # endif ERROR_CHECK
  722. + #endif defined (__M68881__) || defined (sfp004)
  723. *** 1.4    1992/02/03 20:19:23
  724. --- csin.c    1992/03/06 19:38:01
  725. ***************
  726. *** 61,69 ****
  727.    *
  728.    */
  729.   
  730. ! #if defined (__M68881__) && !defined (_M68881)
  731. ! /*# define _M68881*/
  732. ! #endif
  733.   
  734.   #include <stdio.h>
  735.   #include <math.h>
  736. --- 61,67 ----
  737.    *
  738.    */
  739.   
  740. ! #if !defined (__M68881__) && !defined (sfp004)
  741.   
  742.   #include <stdio.h>
  743.   #include <math.h>
  744. ***************
  745. *** 78,80 ****
  746. --- 76,190 ----
  747.       result.imag = cos (z.real) * sinh (z.imag);
  748.       return (result);
  749.   }
  750. + #endif !defined (__M68881__) && !defined (sfp004)
  751. + #ifdef    __M68881__
  752. + __asm("
  753. + .text
  754. + _funcname:
  755. +     .ascii    \"csin\\0\"
  756. +     .even
  757. +     .globl _csin
  758. + _csin:
  759. +     movel    a1,d0        | save a1 as return value
  760. +     fmoved    sp@(4),fp0    | z.real
  761. +     fcosx    fp0,fp1        | cos(z.real)
  762. +     fsinx    fp0,fp0        | sin(z.real)
  763. +     fmoved    sp@(12),fp3    | z.imag
  764. +     fcoshx    fp3,fp2        | cosh(z.imag)
  765. +     fsinhx    fp3,fp3        | sinh(z.imag)
  766. +     
  767. +     fmulx    fp2,fp0        | result.real
  768. +     fmoved    fp0,a1@        |
  769. +     fmulx    fp3,fp1        | result.imag
  770. +     fmoved    fp1,a1@(8)    |
  771. + ");    /* end asm    */
  772. + #endif    __M68881__
  773. + #ifdef    sfp004
  774. + __asm("
  775. + | double precision floating point stuff for Atari-gcc using the SFP004
  776. + | developed with gas
  777. + |
  778. + | double precision complex sin
  779. + |
  780. + | M. Ritzert (mjr at dmzrzu71)
  781. + |
  782. + | 12.10.1990
  783. + |
  784. + | addresses of the 68881 data port. This choice is fastest when much data is
  785. + | transferred between the two processors.
  786. + comm =     -6
  787. + resp =    -16
  788. + zahl =      0
  789. + | waiting loop ...
  790. + |
  791. + | wait:
  792. + | ww:    cmpiw    #0x8900,a1@(resp)
  793. + |     beq    ww
  794. + | is coded directly by
  795. + |    .long    0x0c688900, 0xfff067f8
  796. + | and
  797. + | www:    tst.b    a1@(resp)
  798. + |    bmi.b    www
  799. + | is coded by
  800. + |    .word    0x4a68,0xfff0,0x6bfa        | test
  801. +     .text; .even
  802. +     .globl _csin
  803. + _csin:
  804. +     movel    a1,d0                | save a1 as return value
  805. +     lea    0xfffa50,a0            | fpu address
  806. +     movew    #0x5431,a0@(comm)        | sincos: sin -> fp0 
  807. +     .long    0x0c688900, 0xfff067f8        |      cos -> fp1
  808. +     movel    sp@(4), a0@            | load z.real
  809. +     movel    sp@(8), a0@            | load z.real
  810. + |    fmoved    sp@(12),fp3            | z.imag to fp3
  811. +     movew    #0x5580,a0@(comm)
  812. +     .long    0x0c688900, 0xfff067f8
  813. +     movel    sp@(12),a0@
  814. +     movel    sp@(16),a0@
  815. + |    fcoshx    fp3,fp2                | cosh(z.imag)
  816. +     movew    #0x0d19,a0@(comm)
  817. +     .word    0x4a68,0xfff0,0x6bfa        | test
  818. + |    fsinhx    fp3,fp3                | sinh(z.imag)
  819. +     movew    #0x0d82,a0@(comm)
  820. +     .word    0x4a68,0xfff0,0x6bfa        | test
  821. + |    fmulx    fp2,fp0                | result.real
  822. +     movew    #0x0823,a0@(comm)
  823. +     .word    0x4a68,0xfff0,0x6bfa        | test
  824. + |    fmoved    fp0,a1@                |
  825. +     movew    #0x7400,a0@(comm)        | 
  826. +     .long    0x0c688900, 0xfff067f8
  827. +     movel    a0@,a1@
  828. +     movel    a0@,a1@(4)
  829. + |    fmulx    fp3,fp1                | result.imag
  830. +     movew    #0x0ca3,a0@(comm)
  831. +     .word    0x4a68,0xfff0,0x6bfa        | test
  832. + |    fmoves    fp1,d1                |
  833. +     movew    #0x7480,a0@(comm)        |
  834. +     .long    0x0c688900, 0xfff067f8
  835. +     movel    a0@,a1@(8)
  836. +     movel    a0@,a1@(12)
  837. + ");    /* end asm    */
  838. + #endif    sfp004
  839. + #if defined (__M68881__) || defined (sfp004)
  840. + # ifdef ERROR_CHECK    /* no error checking for now    */
  841. + __asm("
  842. +     pea    _funcname
  843. +     jmp    c_err_check
  844. + ");    /* end asm    */
  845. + # else  ERROR_CHECK
  846. + __asm("rts");
  847. + # endif ERROR_CHECK
  848. + #endif defined (__M68881__) || defined (sfp004)
  849. *** 1.3    1992/02/03 20:19:23
  850. --- csubt.c    1992/03/06 19:38:02
  851. ***************
  852. *** 124,131 ****
  853.   
  854.       movew    #0x5428,a0@(comm)    | fp0 -= z2.real
  855.       .long    0x0c688900, 0xfff067f8
  856. !     movel    a7@(4),a0@        | load arg_hi
  857. !     movel    a7@(8),a0@        | load arg_low
  858.   
  859.       movew    #0x5480,a0@(comm)    | z1.imag -> fp1
  860.       .long    0x0c688900, 0xfff067f8
  861. --- 124,131 ----
  862.   
  863.       movew    #0x5428,a0@(comm)    | fp0 -= z2.real
  864.       .long    0x0c688900, 0xfff067f8
  865. !     movel    a7@(20),a0@        | load arg_hi
  866. !     movel    a7@(24),a0@        | load arg_low
  867.   
  868.       movew    #0x5480,a0@(comm)    | z1.imag -> fp1
  869.       .long    0x0c688900, 0xfff067f8
  870. ***************
  871. *** 133,142 ****
  872.       movel    a7@(16),a0@        | load arg_low
  873.   
  874.       movew    #0x54a8,a0@(comm)    | fp1 -= z2.imag
  875. !     movel    a1,d0             pointer to result
  876.       .long    0x0c688900, 0xfff067f8
  877. !     movel    a7@(4),a0@        | load arg_hi
  878. !     movel    a7@(8),a0@        | load arg_low
  879.   
  880.   |    movew    #%0111 0101 0000 0000,a0@(comm)    | fetch fp0
  881.       movew    #0x7400,a0@(comm)        | 
  882. --- 133,142 ----
  883.       movel    a7@(16),a0@        | load arg_low
  884.   
  885.       movew    #0x54a8,a0@(comm)    | fp1 -= z2.imag
  886. !     movel    a1,d0            | pointer to result
  887.       .long    0x0c688900, 0xfff067f8
  888. !     movel    a7@(28),a0@        | load arg_hi
  889. !     movel    a7@(32),a0@        | load arg_low
  890.   
  891.   |    movew    #%0111 0101 0000 0000,a0@(comm)    | fetch fp0
  892.       movew    #0x7400,a0@(comm)        | 
  893.